

const useStore = defineStore(
    'portal',
    {
        state: () => (
            {
                data: null,
                favoritesMenuList: [],
                // 列表
                getCommonAppList: []
            }
        ),
        actions: {
            setData(data) {
                this.data = data;

                if (!data || !data.favoritesMenuList || !data.favoritesMenuList.length) {
                    this.favoritesMenuList = [];
                } else {
                    this.favoritesMenuList = data.favoritesMenuList;
                }
            },
            getFavoritesMenuList() {
                return this.favoritesMenuList;
            },
            setFavoritesMenuList(menuList) {
                debugger
                this.favoritesMenuList = menuList;
            }
        }
    })

export default useStore